#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time    : 2021/1/18 下午3:47
# @Author  : fugang_le
# @Software: PyCharm


import threading
import os


class ThreadTrackId():
    thread_trackId = dict()

    @classmethod
    def get_trackId(cls, pid_tid):
        return cls.thread_trackId.get(pid_tid, 'trackId')

    @classmethod
    def update_trackId(cls, pid_tid, trackId):
        cls.thread_trackId[pid_tid] = trackId

    @classmethod
    def get_pid_tid(cls):
        tid = threading.currentThread().ident
        return str(tid)

    @classmethod
    def get_trackId_op(cls):
        tid = threading.currentThread().ident
        pid_tid = str(tid)
        return cls.thread_trackId.get(pid_tid, 'trackId')


if __name__ == '__main__':
    print(ThreadTrackId.get_trackId_op())
